#ifndef _RSSDOCUMENTLINKMGR_H
#define _RSSDOCUMENTLINKMGR_H

#include "RSSDocumentLink.h"
#include "Date.h"
#include "LinkedList.h"
#include <string>

using namespace std;
using namespace userDate;

// Class Define /////////////////////////////////////////////////////////////////////////////

class RSSDocumentLinkMGR
{	
	public:
		 typedef unsigned short int UShort;
		 enum Month   { Jan=1, Feb=2, Mar=3, Apr=4, Mav=5, Jun=6, Jul=7, Aug=8, Sep=9, Oct=10, Nov=11, Dec=12 };
	
	public:	//Default Function : Create & Destroy, Operator
		RSSDocumentLinkMGR();
		RSSDocumentLinkMGR( const RSSDocumentLinkMGR& source );
		~RSSDocumentLinkMGR();

		RSSDocumentLinkMGR& operator = ( const RSSDocumentLinkMGR& source );

	public:	//Access Function
		int GetLinkCount() const;
		RSSDocumentLink& operator [] (int index );
		
	public:	//General Function
		RSSDocumentLink* Record( string link, Date lastRenewalDate );
		RSSDocumentLink* Find( string link );
		void LoadDB();

	public: //Compare Function
		friend int CompareByRSSLink( void* one, void* other);

	private: //Members
		int count;
		LinkedList<RSSDocumentLink> rssDocumentLinks;
};



// Inline Function //////////////////////////////////////////////////////////////////////////

inline int RSSDocumentLinkMGR::GetLinkCount() const
{
	return this->count;
}

inline RSSDocumentLink& RSSDocumentLinkMGR::operator [] (int index )
{
	return const_cast<RSSDocumentLink&>( (this->rssDocumentLinks)[index] );
}

#endif
		
		
